<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>gifbuild</title><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /></head><body><div class="refentry"><a id="gifbuild.1"></a><div class="titlepage"></div><div class="refnamediv"><a id="name"></a><h2>Name</h2><p>gifbuild — dump GIF data in a textual format, or undump it to a GIF</p></div><div class="refsynopsisdiv"><a id="synopsis"></a><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">gifbuild</code>  [-v] [-a] [-d] [-t <em class="replaceable"><code>translation-table</code></em>] [-h] [<em class="replaceable"><code>gif-file</code></em>]</p></div></div><div class="refsect1"><a id="idm23"></a><h2>Options</h2><p>A program to convert a series of editable text GIF icon specifications and
named GIF files into a multi-image GIF, usable as a graphic resource file.
It can also dump existing GIFs in this format.  When dumping a GIF,
certain sanity checks are performed which may result in a warning
emitted to standard error.</p><p>If no GIF file is given, gifbuild will try to read a text input
from stdin.</p></div><div class="refsect1"><a id="idm27"></a><h2>Specification Syntax</h2><p>Here is a syntax summary in informal BNF.  The token `NL' represents a
required newline.</p><pre class="programlisting">
&lt;gif-spec&gt; ::= &lt;header-block&gt; &lt;image-block&gt;...

&lt;header-block&gt; ::= &lt;header-declaration&gt;...

&lt;header-declaration ::=
		| screen width &lt;digits&gt; NL
		| screen height &lt;digits&gt; NL
		| screen colors &lt;digits&gt; NL
		| screen background &lt;digits&gt; NL
		| pixel aspect byte &lt;digits&gt; NL
		| screen map &lt;color-table&gt; NL

&lt;color-table&gt; ::= &lt;color-declaration&gt;... end NL

&lt;color-declaration&gt; ::= rgb &lt;digits&gt; &lt;digits&gt; &lt;digits&gt; [ is &lt;key&gt;] NL
                | sort flag {on|off} NL

&lt;image-block&gt; ::= include &lt;file-name&gt; NL
		| image NL
			&lt;image-declaration&gt;...
			&lt;raster-picture&gt;
			[ &lt;extension&gt; ]

&lt;image-declarations&gt; ::= image top &lt;digits&gt; NL
			| image left &lt;digits&gt; NL
			| image interlaced NL
			| image map &lt;color-table&gt; NL
			| image bits &lt;digits&gt; by &lt;digits&gt; [hex|ascii] NL &lt;raster-block&gt;

&lt;extension&gt; := &lt;comment&gt; NL &lt;extension-block&gt; NL end NL
		| &lt;plaintext&gt; NL &lt;extension-block&gt; NL end NL
                | graphics control NL &lt;GCB-part&gt; NL end NL
                | netscape loop  &lt;digits&gt; NL
		| extension &lt;hex-digits&gt; NL &lt;extension-block&gt; NL end NL

&lt;GCB-part&gt; ::= disposal mode &lt;digits&gt; NL
                | user input flag {on|off} NL
                | delay &lt;digits&gt; NL
                | transparent index &lt;digits&gt; NL

</pre><p>If the data types of the <span class="quote">“<span class="quote">screen height</span>”</span>,
<span class="quote">“<span class="quote">screen width</span>”</span>, <span class="quote">“<span class="quote">screen background</span>”</span>,
<span class="quote">“<span class="quote">image top</span>”</span>, and <span class="quote">“<span class="quote">image left</span>”</span> declarations
aren't obvious to you, what are you doing with this software?</p><p>The <span class="quote">“<span class="quote">pixel aspect byte</span>”</span> declaration sets an integer 
denominator for a fraction expressing the puxel aspect ratio.  See the
GIF standard for details; this field is actually long obsolete.</p><p>A color table declares color indices (in ascending order from 0)
and may associate them with key characters (these associations are
absent when the map is more than 94 colors lang and raster blocks
using it must use hex pairs).  These characters can later be used in
raster blocks.  As these must be printable and non-whitespace, you can
only specify 94 colors per icon.  Life is like that sometimes.</p><p>A color table declaration can also set the table's sort flag with 
"sort flag on" or "sort flag off" on any line before the end.</p><p>An <span class="quote">“<span class="quote">ascii</span>”</span> raster block is just a block of key
characters (used for a color map of 94 or fewer colors).  A
<span class="quote">“<span class="quote">hex</span>”</span> raster block uses hex digit pairs instead (used for
a color map with more than 94 colors). The default is ASCII.  It
should be sized correctly for the <span class="quote">“<span class="quote">image bits</span>”</span>
declaration that leads it. Raster blocks from interlaced GIFs are
dumped with the lines in non-interlaced order.</p><p>The <span class="quote">“<span class="quote">comment</span>”</span>, <span class="quote">“<span class="quote">plaintext</span>”</span> or
<span class="quote">“<span class="quote">ggraphics control</span>”</span> keywords lead defined GIF89 extension
record data. The final GIF89 type, graphics control and application
block, are not yet supported, but the code does recognize a Netscape
loop block.  You can also say <span class="quote">“<span class="quote">extension</span>”</span> followed by a
hexadecimal record type.  All of these extension declarations must be
followed by an extension block, which is terminated by the keyword
<span class="quote">“<span class="quote">end</span>”</span> on its own line.</p><p>An extension block is a series of text lines, each interpreted
as a string of bytes to fill an extension block (the terminating
newline is stripped).  Text may include standard C-style octal and hex
escapes preceded by a backslash.</p><p>A graphics control block declaration creates a graphics control
extension block; for the field semantics see the GIF89 standard, part
23.</p><p>A netscape loop declaration creates an application extension
block containing a NETSCAPE 2.0 animation loop control with a
specified repeat count (repeat count 0 means loop forever). This must
be immediately after the header declaration. These loop blocks are
interpreted by the Netscape/Mozilla/Firefox line of browsers.</p><p>All &lt;digits&gt; tokens are interpreted as decimal numerals;
&lt;hex-digits&gt; tokens are interpreted as two hex digits (a byte). All
coordinates are zero-origin with the top left corner (0,0).  Range
checking is weak and signedness checking nonexistent; caveat
hacker!</p><p>In general, the amount of whitespace and order of declarations within a 
header or image block is not significant, except that a raster picture
must immediately follow its <span class="quote">“<span class="quote">image bits</span>”</span> bits declaration.</p><p>The <span class="quote">“<span class="quote">include</span>”</span> declaration includes a named GIF as
the next image.  The global color maps of included GIFs are merged
with the base table defined by any <span class="quote">“<span class="quote">screen color</span>”</span>
declaration.  All images of an included multi-image GIF will be
included in order.</p><p>Comments (preceded with <span class="quote">“<span class="quote">#</span>”</span>) will be ignored.</p></div><div class="refsect1"><a id="idm62"></a><h2>Options</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">-v</span></dt><dd><p>Verbose mode (show progress).
Enables printout of running scan lines.</p></dd><dt><span class="term">-d</span></dt><dd><p> Dump the input GIF file(s) into the text form described
above.</p></dd><dt><span class="term">-t</span></dt><dd><p>Specify name characters to use when dumping raster blocks.  Only
valid with -d option.</p></dd><dt><span class="term">-h</span></dt><dd><p>Print one line of command line help, similar to Usage
above.</p></dd></dl></div></div><div class="refsect1"><a id="idm81"></a><h2>Bugs</h2><p>Error checking is rudimentary.</p></div><div class="refsect1"><a id="idm84"></a><h2>Example:</h2><p>A sample icon file called <code class="filename">sample.ico</code> is
included in the pic directory of the GIFLIB source
distribution.</p></div><div class="refsect1"><a id="idm88"></a><h2>Author</h2><p>Eric S. Raymond <code class="email">&lt;<a class="email" href="mailto:esr@thyrsus.com">esr@thyrsus.com</a>&gt;</code></p></div></div></body></html>